<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#writeBtn").click(function(){
			location.href="letter.do?command=letterForm";
		});
	});
</script>
<style type="text/css"> 
	table#con_table{width:800px; color:#555555; font-size:12px; text-align:center; border-top:1px solid #575757;border-bottom:1px solid #575757}
	table#con_table a{text-decoration:none; color:#CDA9A9;}
	table#con_table a:hover{text-decoration:underline; color:#892525;}
	table#con_table th{background:#A1CF36; padding:8px 0; border-bottom:1px solid #7B7B7B}
	table#con_table td{padding:10px 0 10px 0; background:#fff;border-bottom:1px dashed #CDCDCD}
	table#con_table tr.gry td{background:#f2f2f0;}
	table#con_table tr.last td{border-bottom:0px;}
</style>
<script type="text/javascript">
	function tdBgChanger(){
		var trs = document.getElementById('con_table').getElementsByTagName('tr');
		var finalNum = Number(trs.length - 1);
		for(var j=0;j<trs.length;j++){
			
			if(j%2 == 0){
				trs[j].className = 'gry';
				if(j == finalNum){
					trs[j].className = 'gry last';
				}
			}else{
				if(j == finalNum){
					trs[j].className = 'last';
				}
			}
		}
	}
</script>  


<img src="${initParam.root}/img/letter_top.gif"><br>


<table align="center" cellpadding="0" cellspacing="0" id="con_table">

<thead><tr><th>□</th><th>제목</th><th>작성일</th></tr></thead>
<tbody>
<c:forEach items="${requestScope.lvo.list}" var="i">
	<tr><td>◇</td><td width="400" align="center"><a href="letter.do?command=getLetter&letterNo=${i.letterNo}&pageNo=${requestScope.lvo.pagingBean.nowPage}">${i.letterTitle}</a></td><td width="250" align="center">${i.letterWriteDate}</td></tr>
</c:forEach>
</tbody>
</table><br>
<table align="center">
<tr>
<td>
<c:if test="${requestScope.lvo.pagingBean.previousPageGroup}">
	<a href="${initParam.root}/letter.do?command=letterList&pageNo=${requestScope.lvo.pagingBean.startPageOfPageGroup-1}">
	<img src="${initParam.root}/img/left_arrow_btn.gif"></a>
	</c:if>
	
	<c:forEach var="i" begin="${requestScope.lvo.pagingBean.startPageOfPageGroup}" end="${requestScope.lvo.pagingBean.endPageOfPageGroup}">
	<c:choose>
	<c:when test="${requestScope.lvo.pagingBean.nowPage!=i}">
	<a href="${initParam.root}/letter.do?command=letterList&pageNo=${i}">${i}</a>
	</c:when>
	<c:otherwise>
	${i}
	</c:otherwise>
	</c:choose>
	</c:forEach>	 
	 
	<c:if test="${requestScope.lvo.pagingBean.nextPageGroup}">
	<a href="${initParam.root}/letter.do?command=letterList&pageNo=${requestScope.lvo.pagingBean.endPageOfPageGroup+1}">
	<img src="${initParam.root}/img/right_arrow_btn.gif"></a>
	</c:if>
	<br>
</td>
</tr>
</table><br>
<script type="text/javascript" >tdBgChanger()</script>

<c:forEach begin="1" end="10" varStatus="vs">
&nbsp;
</c:forEach>
<span style="margin-left: 750px;"><img src="${initParam.root}/img/write_btn.gif" id="writeBtn"></span>

